let download = function () {
    let xhr = new XMLHttpRequest();
    xhr.response = 'blob';
    xhr.onreadystatechange = function(){
        if (xhr.readyState===4&&xhr.status===200){
            let blob = this.response;
            console.log(blob.type);
            let reader = new FileReader();
            let bd = [];
            bd.push(blob);
            reader.readAsDataURL(new Blob(bd,{type:'application/vnd.openxmlformats-officedocument.presentationml.presentation'}));
            reader.onload = function (e) {
                let a = document.createElement('a');
                a.download = 'new.pptx';
                a.href = e.target.result;
                const download = document.getElementById('download');
                download.appendChild(a);
                a.click();
                document.getElementsByClassName('a').remove();
            }
        }else{
            console.log("Connect to Server error")
        }
    };
    xhr.open("GET","http://localhost:80/download");
    xhr.send()
};